package com.hdyg.sixg.mvp.presenter;

import com.hdyg.sixg.httpUtil.HttpCallback;
import com.hdyg.sixg.mvp.Contrant.CMining;
import com.hdyg.sixg.mvp.base.BasePresenter;
import com.hdyg.sixg.util.ToastUtil;
import java.util.Map;

/**
 * @author CZB
 * @describe 挖矿
 * @time 2019/4/22 9:54
 */
public class PMining extends BasePresenter implements CMining.IPMining {

    private CMining.IVMining mView;

    public PMining(CMining.IVMining mView) {
        this.mView = mView;
    }

    @Override
    public void pGetMining(String path, Map<String, String> params) {
        mModel.post(path, params, new HttpCallback(false) {
            @Override
            public void onSuccess(Object dataBean) {
                mView.vGetMiningSuccess(dataBean.toString());
            }

            @Override
            public void onFail(String code, String error) {
                mView.vGetMiningFail(error);
                ToastUtil.show(error);
            }
        });
    }
}
